package org.sy.lab.多线程基础._2_同步._2_ReentrantLock._4_使用条件;

public class Drunkard implements Runnable {
	
	private Counter counter;
	
	public Drunkard(Counter counter) {
		this.counter = counter;
	}

	@Override
	public void run() {
		while (counter.isOpen() || counter.hasBeer()) {
			counter.getBeer();
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
